apiVersion: v1
kind: ConfigMap
metadata:
  name: k8s-app-config
  labels:
    app: k8s-app
data:
  SPRING_DATASOURCE_URL: "jdbc:postgresql://10.110.188.127:5432/k8s_db"
  POSTGRES_USER: "postgres"
  POSTGRES_PASSWORD: "admin1234"
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: k8s-app-deployment
  labels:
    app: k8s-app
spec:
  replicas: 1
  selector:
    matchLabels:
      app: k8s-app
  template:
    metadata:
      labels:
        app: k8s-app
    spec:
      containers:
        - name: k8s-app-backend-container
          image: olegprog2020/k8s-app:1.0
          ports:
            - containerPort: 8080
          envFrom:
            - configMapRef:
                name: k8s-app-config